﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbHatch : OdDbEntity
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbHatch(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbHatch_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbHatch obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbHatch()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbHatch(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbHatch cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbHatch_cast(OdRxObject.getCPtr(pObj));
			OdDbHatch result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHatch)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHatch)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHatch)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbHatch_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbHatch_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbHatch_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbHatch createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbHatch_createObject();
			OdDbHatch result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHatch)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHatch)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHatch)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double elevation()
		{
			double result = TD_DbPINVOKE.OdDbHatch_elevation(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setElevation(double elevation)
		{
			TD_DbPINVOKE.OdDbHatch_setElevation(this.swigCPtr, elevation);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeVector3d normal()
		{
			OdGeVector3d result = new OdGeVector3d(TD_DbPINVOKE.OdDbHatch_normal(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setNormal(OdGeVector3d normal)
		{
			TD_DbPINVOKE.OdDbHatch_setNormal(this.swigCPtr, OdGeVector3d.getCPtr(normal));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual bool isPlanar()
		{
			bool result = TD_DbPINVOKE.OdDbHatch_isPlanar(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult getPlane(OdGePlane plane, out Planarity planarity)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_getPlane(this.swigCPtr, OdGePlane.getCPtr(plane), out planarity);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int numLoops()
		{
			int result = TD_DbPINVOKE.OdDbHatch_numLoops(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int loopTypeAt(int loopIndex)
		{
			int result = TD_DbPINVOKE.OdDbHatch_loopTypeAt(this.swigCPtr, loopIndex);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getLoopAt(int loopIndex, EdgeArray edgePtrs)
		{
			TD_DbPINVOKE.OdDbHatch_getLoopAt__SWIG_0(this.swigCPtr, loopIndex, EdgeArray.getCPtr(edgePtrs));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getLoopAt(int loopIndex, OdGePoint2dArray vertices, OdGeDoubleArray bulges)
		{
			TD_DbPINVOKE.OdDbHatch_getLoopAt__SWIG_1(this.swigCPtr, loopIndex, OdGePoint2dArray.getCPtr(vertices).Handle, OdGeDoubleArray.getCPtr(bulges));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void appendLoop(int loopType, EdgeArray edgePtrs)
		{
			TD_DbPINVOKE.OdDbHatch_appendLoop__SWIG_0(this.swigCPtr, loopType, EdgeArray.getCPtr(edgePtrs));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void appendOrderedLoop(int loopType, EdgeArray edgePtrs)
		{
			TD_DbPINVOKE.OdDbHatch_appendOrderedLoop(this.swigCPtr, loopType, EdgeArray.getCPtr(edgePtrs));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void appendLoop(int loopType, OdGePoint2dArray vertices, OdGeDoubleArray bulges)
		{
			TD_DbPINVOKE.OdDbHatch_appendLoop__SWIG_1(this.swigCPtr, loopType, OdGePoint2dArray.getCPtr(vertices).Handle, OdGeDoubleArray.getCPtr(bulges));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void appendLoop(int loopType, OdDbObjectIdArray dbObjIds)
		{
			TD_DbPINVOKE.OdDbHatch_appendLoop__SWIG_2(this.swigCPtr, loopType, OdDbObjectIdArray.getCPtr(dbObjIds));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void insertLoopAt(int loopIndex, int loopType, EdgeArray edgePtrs)
		{
			TD_DbPINVOKE.OdDbHatch_insertLoopAt__SWIG_0(this.swigCPtr, loopIndex, loopType, EdgeArray.getCPtr(edgePtrs));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void insertLoopAt(int loopIndex, int loopType, OdGePoint2dArray vertices, OdGeDoubleArray bulges)
		{
			TD_DbPINVOKE.OdDbHatch_insertLoopAt__SWIG_1(this.swigCPtr, loopIndex, loopType, OdGePoint2dArray.getCPtr(vertices).Handle, OdGeDoubleArray.getCPtr(bulges));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void insertLoopAt(int loopIndex, int loopType, OdDbObjectIdArray dbObjIds)
		{
			TD_DbPINVOKE.OdDbHatch_insertLoopAt__SWIG_2(this.swigCPtr, loopIndex, loopType, OdDbObjectIdArray.getCPtr(dbObjIds));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void removeLoopAt(int loopIndex)
		{
			TD_DbPINVOKE.OdDbHatch_removeLoopAt(this.swigCPtr, loopIndex);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool associative()
		{
			bool result = TD_DbPINVOKE.OdDbHatch_associative(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAssociative(bool isAssociative)
		{
			TD_DbPINVOKE.OdDbHatch_setAssociative(this.swigCPtr, isAssociative);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getAssocObjIdsAt(int loopIndex, OdDbObjectIdArray dbObjIds)
		{
			TD_DbPINVOKE.OdDbHatch_getAssocObjIdsAt(this.swigCPtr, loopIndex, OdDbObjectIdArray.getCPtr(dbObjIds));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getAssocObjIds(OdDbObjectIdArray dbObjIds)
		{
			TD_DbPINVOKE.OdDbHatch_getAssocObjIds(this.swigCPtr, OdDbObjectIdArray.getCPtr(dbObjIds));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setAssocObjIdsAt(int loopIndex, OdDbObjectIdArray dbObjIds)
		{
			TD_DbPINVOKE.OdDbHatch_setAssocObjIdsAt(this.swigCPtr, loopIndex, OdDbObjectIdArray.getCPtr(dbObjIds));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void removeAssocObjIds()
		{
			TD_DbPINVOKE.OdDbHatch_removeAssocObjIds(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbHatch.HatchPatternType patternType()
		{
			OdDbHatch.HatchPatternType result = (OdDbHatch.HatchPatternType)TD_DbPINVOKE.OdDbHatch_patternType(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isSolidFill()
		{
			bool result = TD_DbPINVOKE.OdDbHatch_isSolidFill(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public string patternName()
		{
			string result = TD_DbPINVOKE.OdDbHatch_patternName(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPattern(OdDbHatch.HatchPatternType patType, string patName)
		{
			TD_DbPINVOKE.OdDbHatch_setPattern__SWIG_0(this.swigCPtr, (int)patType, patName);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setPattern(OdDbHatch.HatchPatternType patType, string patName, double angle, double scale, OdHatchPattern pat, OdGePoint2d basePt)
		{
			TD_DbPINVOKE.OdDbHatch_setPattern__SWIG_1(this.swigCPtr, (int)patType, patName, angle, scale, OdHatchPattern.getCPtr(pat), OdGePoint2d.getCPtr(basePt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setPattern(OdDbHatch.HatchPatternType patType, string patName, double angle, double scale, OdHatchPattern pat)
		{
			TD_DbPINVOKE.OdDbHatch_setPattern__SWIG_2(this.swigCPtr, (int)patType, patName, angle, scale, OdHatchPattern.getCPtr(pat));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double patternAngle()
		{
			double result = TD_DbPINVOKE.OdDbHatch_patternAngle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPatternAngle(double angle)
		{
			TD_DbPINVOKE.OdDbHatch_setPatternAngle(this.swigCPtr, angle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double patternSpace()
		{
			double result = TD_DbPINVOKE.OdDbHatch_patternSpace(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPatternSpace(double space)
		{
			TD_DbPINVOKE.OdDbHatch_setPatternSpace(this.swigCPtr, space);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double patternScale()
		{
			double result = TD_DbPINVOKE.OdDbHatch_patternScale(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPatternScale(double scale)
		{
			TD_DbPINVOKE.OdDbHatch_setPatternScale(this.swigCPtr, scale);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool patternDouble()
		{
			bool result = TD_DbPINVOKE.OdDbHatch_patternDouble(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPatternDouble(bool isDouble)
		{
			TD_DbPINVOKE.OdDbHatch_setPatternDouble(this.swigCPtr, isDouble);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int numPatternDefinitions()
		{
			int result = TD_DbPINVOKE.OdDbHatch_numPatternDefinitions(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getPatternDefinitionAt(int lineIndex, out double lineAngle, out double baseX, out double baseY, out double offsetX, out double offsetY, OdGeDoubleArray dashes)
		{
			TD_DbPINVOKE.OdDbHatch_getPatternDefinitionAt(this.swigCPtr, lineIndex, out lineAngle, out baseX, out baseY, out offsetX, out offsetY, OdGeDoubleArray.getCPtr(dashes));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbHatch.HatchStyle hatchStyle()
		{
			OdDbHatch.HatchStyle result = (OdDbHatch.HatchStyle)TD_DbPINVOKE.OdDbHatch_hatchStyle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setHatchStyle(OdDbHatch.HatchStyle hatchStyle)
		{
			TD_DbPINVOKE.OdDbHatch_setHatchStyle(this.swigCPtr, (int)hatchStyle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int numSeedPoints()
		{
			int result = TD_DbPINVOKE.OdDbHatch_numSeedPoints(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d getSeedPointAt(uint seedIndex)
		{
			OdGePoint2d result = new OdGePoint2d(TD_DbPINVOKE.OdDbHatch_getSeedPointAt(this.swigCPtr, seedIndex), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setSeedPointAt(uint seedIndex, OdGePoint2d point)
		{
			TD_DbPINVOKE.OdDbHatch_setSeedPointAt(this.swigCPtr, seedIndex, OdGePoint2d.getCPtr(point));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void appendSeedPoint(OdGePoint2d point)
		{
			TD_DbPINVOKE.OdDbHatch_appendSeedPoint(this.swigCPtr, OdGePoint2d.getCPtr(point));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void removeSeedPointAt(int seedPointIndex)
		{
			TD_DbPINVOKE.OdDbHatch_removeSeedPointAt(this.swigCPtr, seedPointIndex);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double pixelSize()
		{
			double result = TD_DbPINVOKE.OdDbHatch_pixelSize(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPixelSize(double pixelSize)
		{
			TD_DbPINVOKE.OdDbHatch_setPixelSize(this.swigCPtr, pixelSize);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dwgInFields(OdDbDwgFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbHatch_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbHatch_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult subGetClassID(IntPtr pClsid)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_subGetClassID(this.swigCPtr, pClsid);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual bool subWorldDraw(OdGiWorldDraw pWd)
		{
			bool result = TD_DbPINVOKE.OdDbHatch_subWorldDraw(this.swigCPtr, OdGiWorldDraw.getCPtr(pWd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void subViewportDraw(OdGiViewportDraw pWd)
		{
			TD_DbPINVOKE.OdDbHatch_subViewportDraw(this.swigCPtr, OdGiViewportDraw.getCPtr(pWd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult subTransformBy(OdGeMatrix3d xfm)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_subTransformBy(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetTransformedCopy(OdGeMatrix3d xfm, out OdDbEntity pCopy)
		{
			IntPtr zero = IntPtr.Zero;
			OdResult result;
			try
			{
				OdResult odResult = (OdResult)TD_DbPINVOKE.OdDbHatch_subGetTransformedCopy(this.swigCPtr, OdGeMatrix3d.getCPtr(xfm), out zero);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = odResult;
			}
			finally
			{
				pCopy = (OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(zero, true);
			}
			return result;
		}

		public new virtual OdDbObject decomposeForSave(DwgVersion ver, OdDbObjectId replaceId, out bool exchangeXData)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbHatch_decomposeForSave(this.swigCPtr, (int)ver, OdDbObjectId.getCPtr(replaceId), out exchangeXData);
			OdDbObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult evaluateHatch(bool bUnderestimateNumLines)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_evaluateHatch__SWIG_0(this.swigCPtr, bUnderestimateNumLines);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult evaluateHatch()
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_evaluateHatch__SWIG_1(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int numHatchLines()
		{
			int result = TD_DbPINVOKE.OdDbHatch_numHatchLines(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getHatchLineDataAt(int lineIndex, OdGePoint2d startPoint, OdGePoint2d endPoint)
		{
			TD_DbPINVOKE.OdDbHatch_getHatchLineDataAt(this.swigCPtr, lineIndex, OdGePoint2d.getCPtr(startPoint), OdGePoint2d.getCPtr(endPoint));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getHatchLinesData(OdGePoint2dArray startPoints, OdGePoint2dArray endPoints)
		{
			TD_DbPINVOKE.OdDbHatch_getHatchLinesData(this.swigCPtr, OdGePoint2dArray.getCPtr(startPoints).Handle, OdGePoint2dArray.getCPtr(endPoints).Handle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult subExplode(OdRxObjectPtrArray entitySet)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_subExplode(this.swigCPtr, OdRxObjectPtrArray.getCPtr(entitySet));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void modifiedGraphics(OdDbObject pObject)
		{
			TD_DbPINVOKE.OdDbHatch_modifiedGraphics(this.swigCPtr, OdDbObject.getCPtr(pObject));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbHatch.HatchObjectType hatchObjectType()
		{
			OdDbHatch.HatchObjectType result = (OdDbHatch.HatchObjectType)TD_DbPINVOKE.OdDbHatch_hatchObjectType(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setHatchObjectType(OdDbHatch.HatchObjectType hatchObjectType)
		{
			TD_DbPINVOKE.OdDbHatch_setHatchObjectType(this.swigCPtr, (int)hatchObjectType);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool isGradient()
		{
			bool result = TD_DbPINVOKE.OdDbHatch_isGradient(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual bool isHatch()
		{
			bool result = TD_DbPINVOKE.OdDbHatch_isHatch(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbHatch.GradientPatternType gradientType()
		{
			OdDbHatch.GradientPatternType result = (OdDbHatch.GradientPatternType)TD_DbPINVOKE.OdDbHatch_gradientType(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public string gradientName()
		{
			string result = TD_DbPINVOKE.OdDbHatch_gradientName(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setGradient(OdDbHatch.GradientPatternType gradientType, string gradientName)
		{
			TD_DbPINVOKE.OdDbHatch_setGradient(this.swigCPtr, (int)gradientType, gradientName);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double gradientAngle()
		{
			double result = TD_DbPINVOKE.OdDbHatch_gradientAngle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setGradientAngle(double angle)
		{
			TD_DbPINVOKE.OdDbHatch_setGradientAngle(this.swigCPtr, angle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getGradientColors(OdCmColorArray colors, OdGeDoubleArray values)
		{
			TD_DbPINVOKE.OdDbHatch_getGradientColors(this.swigCPtr, OdCmColorArray.getCPtr(colors), OdGeDoubleArray.getCPtr(values));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setGradientColors(HatchGradientColors count)
		{
			IntPtr intPtr = count.Marshal();
			try
			{
				TD_DbPINVOKE.OdDbHatch_setGradientColors(this.swigCPtr, intPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				Marshal.FreeCoTaskMem(intPtr);
			}
		}

		public bool getGradientOneColorMode()
		{
			bool result = TD_DbPINVOKE.OdDbHatch_getGradientOneColorMode(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setGradientOneColorMode(bool oneColorMode)
		{
			TD_DbPINVOKE.OdDbHatch_setGradientOneColorMode(this.swigCPtr, oneColorMode);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double getShadeTintValue()
		{
			double result = TD_DbPINVOKE.OdDbHatch_getShadeTintValue(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setShadeTintValue(double luminance)
		{
			TD_DbPINVOKE.OdDbHatch_setShadeTintValue(this.swigCPtr, luminance);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double gradientShift()
		{
			double result = TD_DbPINVOKE.OdDbHatch_gradientShift(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setGradientShift(double gradientShift)
		{
			TD_DbPINVOKE.OdDbHatch_setGradientShift(this.swigCPtr, gradientShift);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void evaluateGradientColorAt(double value, OdCmColor color)
		{
			TD_DbPINVOKE.OdDbHatch_evaluateGradientColorAt(this.swigCPtr, value, OdCmColor.getCPtr(color));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void appendToOwner(OdDbIdPair idPair, OdDbObject pOwnerObject, OdDbIdMapping ownerIdMap)
		{
			TD_DbPINVOKE.OdDbHatch_appendToOwner(this.swigCPtr, OdDbIdPair.getCPtr(idPair), OdDbObject.getCPtr(pOwnerObject), OdDbIdMapping.getCPtr(ownerIdMap));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void subClose()
		{
			TD_DbPINVOKE.OdDbHatch_subClose(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setRawPattern(OdDbHatch.HatchPatternType patType, string patName, double angle, double scale, OdHatchPattern pat)
		{
			TD_DbPINVOKE.OdDbHatch_setRawPattern(this.swigCPtr, (int)patType, patName, angle, scale, OdHatchPattern.getCPtr(pat));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdHatchPattern getPattern()
		{
			OdHatchPattern result = new OdHatchPattern(TD_DbPINVOKE.OdDbHatch_getPattern(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdHatchPattern getRawPattern()
		{
			OdHatchPattern result = new OdHatchPattern(TD_DbPINVOKE.OdDbHatch_getRawPattern(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setOriginPoint(OdGePoint2d pt)
		{
			TD_DbPINVOKE.OdDbHatch_setOriginPoint(this.swigCPtr, OdGePoint2d.getCPtr(pt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint2d originPoint()
		{
			OdGePoint2d result = new OdGePoint2d(TD_DbPINVOKE.OdDbHatch_originPoint(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult explodeGeometry(OdRxObjectPtrArray entitySet)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_explodeGeometry(this.swigCPtr, OdRxObjectPtrArray.getCPtr(entitySet));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult getArea(out double area)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_getArea(this.swigCPtr, out area);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetSubentPathsAtGsMarker(SubentType type, IntPtr gsMark, OdGePoint3d pickPoint, OdGeMatrix3d xfm, OdDbFullSubentPathArray subentPaths, OdDbObjectIdArray pEntAndInsertStack)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_subGetSubentPathsAtGsMarker__SWIG_0(this.swigCPtr, (int)type, gsMark, OdGePoint3d.getCPtr(pickPoint), OdGeMatrix3d.getCPtr(xfm), OdDbFullSubentPathArray.getCPtr(subentPaths), OdDbObjectIdArray.getCPtr(pEntAndInsertStack));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetSubentPathsAtGsMarker(SubentType type, IntPtr gsMark, OdGePoint3d pickPoint, OdGeMatrix3d xfm, OdDbFullSubentPathArray subentPaths)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_subGetSubentPathsAtGsMarker__SWIG_1(this.swigCPtr, (int)type, gsMark, OdGePoint3d.getCPtr(pickPoint), OdGeMatrix3d.getCPtr(xfm), OdDbFullSubentPathArray.getCPtr(subentPaths));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subGetGsMarkersAtSubentPath(OdDbFullSubentPath subPath, SWIGTYPE_p_OdGsMarkerArray gsMarkers)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatch_subGetGsMarkersAtSubentPath(this.swigCPtr, OdDbFullSubentPath.getCPtr(subPath), SWIGTYPE_p_OdGsMarkerArray.getCPtr(gsMarkers));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdDbEntity subSubentPtr(OdDbFullSubentPath path)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbHatch_subSubentPtr(this.swigCPtr, OdDbFullSubentPath.getCPtr(path));
			OdDbEntity result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbEntity)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdCmColor backgroundColor()
		{
			OdCmColor result = new OdCmColor(TD_DbPINVOKE.OdDbHatch_backgroundColor(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBackgroundColor(OdCmColor color)
		{
			TD_DbPINVOKE.OdDbHatch_setBackgroundColor(this.swigCPtr, OdCmColor.getCPtr(color));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdGeMatrix3d getEcs()
		{
			OdGeMatrix3d result = new OdGeMatrix3d(TD_DbPINVOKE.OdDbHatch_getEcs(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		[Flags]
		public enum HatchLoopType
		{
			kDefault = 0,
			kExternal = 1,
			kPolyline = 2,
			kDerived = 4,
			kTextbox = 8,
			kOutermost = 16,
			kNotClosed = 32,
			kSelfIntersecting = 64,
			kTextIsland = 128,
			kDuplicate = 256,
			kIsAnnotative = 512,
			kDoesNotSupportScale = 1024,
			kForceAnnoAllVisible = 2048,
			kOrientToPaper = 4096,
			kIsAnnotativeBlock = 8192
		}

		public enum HatchEdgeType
		{
			kLine = 1,
			kCirArc,
			kEllArc,
			kSpline
		}

		public enum HatchPatternType
		{
			kUserDefined,
			kPreDefined,
			kCustomDefined
		}

		public enum HatchStyle
		{
			kNormal,
			kOuter,
			kIgnore
		}

		public enum HatchObjectType
		{
			kHatchObject,
			kGradientObject
		}

		public enum GradientPatternType
		{
			kPreDefinedGradient,
			kUserDefinedGradient
		}
	}
}
